﻿#ifndef CAESAR_DEALTIME_H__DEF 
#define CAESAR_DEALTIME_H__DEF
#pragma warning(disable : 4996)
#include <time.h> 

class CDealTime 
{ 
public: 
	CDealTime();
	CDealTime(time_t tm);
	CDealTime(int nYear, int nMonth, int nDay, int nHour, int nMin, int nSec);
	virtual ~CDealTime(); 

public:
	static CDealTime GetLocalTime(); 

public:
	time_t GetTime() const;
	int GetYear() const;
	int GetMonth() const;
	int GetDay() const;
	int GetHour() const;
	int GetMinute() const;
	int GetSecond() const;
	int GetDayOfWeek() const;
	int GetDayOfMonth() const;
	int GetDayOfYear() const; 

public:
	CDealTime& operator=(const CDealTime& timesrc); 
	CDealTime& operator=(const time_t& timesrc); 
	CDealTime operator+(const CDealTime& tm); 
	CDealTime operator+(const time_t tm); 
	CDealTime operator-(const CDealTime& tm); 
	CDealTime operator-(const time_t tm); 
	CDealTime& operator+=(const CDealTime& tm); 
	CDealTime& operator+=(const time_t tm); 
	CDealTime& operator-=(const CDealTime& tm); 
	CDealTime& operator-=(const time_t tm); 
	int operator==(const CDealTime& tm) const; 
	int operator!=(const CDealTime& time ) const; 
	int operator>(const CDealTime& time ) const; 
	int operator>=(const CDealTime& time ) const; 
	int operator<(const CDealTime& time ) const; 
	int operator<=(const CDealTime& time ) const; 

protected: 
	time_t m_time; 
}; 

#endif